exports.toThousands = (value) => {
  if(isNaN(value) || value == null || value == '' || value == undefined) return value;
  let isFu = false;
  if(value < 0) {
    isFu = true;
    value = Math.abs(value);
  }
  value = (value || 0).toString()
  let result = '';
  let x = '';
  let z = value;
  if(value.indexOf('.') != -1){
    x = value.split('.')[1];
    z = value.split('.')[0];
  }
  while (z.length > 3) {
    result = ',' + z.slice(-3) + result;
    z = z.slice(0, z.length - 3);
  }
  if (z) {result = z + result;}
  if (x) {result = result + '.' + x;}
  if(isFu) {result = '-' + result;}
  return result;
}
